package com.bwie.controller;
import com.bwie.pojo.GroupActive;
import com.bwie.service.GroupActiveService;
import com.bwie.service.impl.GroupActiveServiceImpl;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* 拼团活动表(tb_group_active)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/group/active")
@Api(tags = "拼团活动管理")
public class GroupActiveController {
/**
* 服务对象
*/
    @Autowired
    private GroupActiveService groupActiveService;
    
    /**
     * @author: LiuWeiChen
     * @description:
     * @params: 拼团活动查询
     * @return:
     * @date: 2025/7/26 20:30
     */
    @ApiOperation("拼团活动列表查询")
    @PostMapping("/selectGroupActive")
    public R selectGroupActive(@RequestBody PageInfoVo pageInfoVo){
        return groupActiveService.selectGroupActive(pageInfoVo);
    }

    /**
     * @author: LiuWeiChen
     * @description:
     * @params: 拼团活动修改
     * @return:
     * @date: 2025/7/26 20:39
     */
    @ApiOperation("拼团活动修改")
    @PostMapping("/updateGroupActive")
    public R updateGroupActive(@RequestBody @Validated GroupActive groupActive){
        return groupActiveService.updateGroupActive(groupActive);
    }

    /**
     * @author: LiuWeiChen
     * @description:
     * @params: 添加拼团活动
     * @return:
     * @date: 2025/7/26 20:45
     */
    @ApiOperation("添加拼团活动")
    @PostMapping("/addGroupActive")
    public R addGroupActive(@RequestBody @Validated GroupActive groupActive){
        return groupActiveService.addGroupActive(groupActive);
    }

    /**
     * @author: LiuWeiChen
     * @description:
     * @params: 删除拼团活动
     * @return:
     * @date: 2025/7/26 20:48
     */
    @ApiOperation("删除拼团活动")
    @PostMapping("/deleteGroupActive")
    public R deleteGroupActive(@RequestBody GroupActive groupActive){
        return groupActiveService.deleteGroupActive(groupActive);
    }


}
